import request from '@/utils/request'
/**
 * 视图预览接口
 * @param {*} params
 */
export function getContentView(params, type) {
  return request({
    url: '/content/detail',
    method: 'get',
    params,
    headers: { ContentType: type }
  })
}
export function getContentList(params, type) {
  return request({
    url: '/customized-content',
    method: 'get',
    params,
    headers: { ContentType: type }
  })
}
export function delContent(id, type) {
  return request({
    url: `/customized-content/${id}`,
    method: 'delete',
    headers: { ContentType: type }
  })
}

export function handleContentStatus(id, onShelve, type) {
  return request({
    url: `/customized-content/${id}`,
    method: 'patch',
    data: { onShelve },
    headers: { ContentType: type }
  })
}
export function getDetail(id, type) {
  return request({
    url: `/customized-content/${id}`,
    method: 'get',
    headers: { ContentType: type }
  })
}
